#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    int n;
    cin >> n;
    char ch;
    int a, b;
    a = b = 0;
    for(int i = 1; i <= n; i++) {
        cin >> ch;
        if(ch == 'A')
            a++;
        else
            b++;
    }
    if(a > b)
        cout << "A";
    else
        cout << "B";
    return 0;
}
